package ch.supsi.parentalcontrol;

import ch.supsi.mobile.core.ICoreApplicationsManager;
import ch.supsi.mobile.core.applications.AddressesApplication;
import ch.supsi.mobile.core.applications.BrowserApplication;
import ch.supsi.mobile.core.applications.IAddressesApplication;
import ch.supsi.mobile.core.applications.IBrowserApplication;
import ch.supsi.mobile.core.applications.IMessageApplication;
import ch.supsi.mobile.core.applications.IPhoneApplication;

public class CoreApplicationsManager implements ICoreApplicationsManager {

	private IAddressesApplication addressesApp;
	private IBrowserApplication browserApp;
	private IPhoneApplication phoneApp;
	private IMessageApplication messageApp;
	
	public CoreApplicationsManager(IAddressesApplication addApp, IBrowserApplication bwsApp, IMessageApplication mesApp, IPhoneApplication phoApp) {
		setAddressesApp(addApp);
		setBrowserApp(bwsApp);
		setMessageApp(mesApp);
		setPhoneApp(phoApp);
	}
	
	public CoreApplicationsManager() {
		setAddressesApp(new AddressesApplication());
		setBrowserApp(new BrowserApplication());
		//setMessageApp(new MessageApplication());
		//setPhoneApp(new PhoneApplication());
	}

	@Override
	public IAddressesApplication getAddressesApplication() {
		return addressesApp;
	}

	@Override
	public IBrowserApplication getBrowserApplication() {
		return browserApp;
	}

	@Override
	public IMessageApplication getMessageApplication() {
		return messageApp;
	}

	@Override
	public IPhoneApplication getPhoneApplication() {
		return phoneApp;
	}

	private void setAddressesApp(IAddressesApplication addApp) {
		this.addressesApp = addApp;
	}

	private void setBrowserApp(IBrowserApplication bwsApp) {
		this.browserApp = bwsApp;
	}

	private void setMessageApp(IMessageApplication mesApp) {
		this.messageApp = mesApp;
	}

	private void setPhoneApp(IPhoneApplication phoApp) {
		this.phoneApp = phoApp;
	}

}
